import java.util.Date;

import play.*;
import play.jobs.*;
import play.test.*;

import models.*;

@OnApplicationStart
public class Bootstrap extends Job {

	public void doJob() {
		Fixtures.deleteAll();
		/************************* NEW BOOTSTRAP ***************************/
		/********** doctor, inspector2, inspector2, essam ****************/
		IdeaDeveloper doctor = new IdeaDeveloper("DrFatma", "DrFatma",
				"DrFatma", "felsayedmeawad@gmail.com", "1/1/2000", "Owner");
		doctor.save();
		IdeaDeveloper inspector1 = new IdeaDeveloper("inspector1",
				"inspector1", "inspector1", "inspector1@gmail.com", "1/1/2000",
				"inspector1");
		inspector1.save();
		IdeaDeveloper inspector2 = new IdeaDeveloper("inspector2",
				"inspector2", "inspector2", "inspector2@gmail.com", "1/1/2000",
				"inspector2");
		inspector2.save();
		IdeaDeveloper essam = new IdeaDeveloper("essam", "essam", "essam",
				"essam.abdelmoaty@gmail.com", "1/1/2000", "essam");
		essam.save();
		/*************************** C1 ******************************/
		IdeaDeveloper omar = new IdeaDeveloper("omar", "omar", "omar",
				"omarkhaled91@gmail.com", "1/1/2000", "omar");
		omar.save();
		IdeaDeveloper otherOmar = new IdeaDeveloper("otherOmar", "otherOmar",
				"omar.el1000@gmail.com", "otherOmar@gmail.com", "1/1/2000",
				"otherOmar");
		otherOmar.save();
		IdeaDeveloper maryam = new IdeaDeveloper("maryam", "maryam", "maryam",
				"maryam.assaedi@gmail.com", "1/1/2000", "maryam");
		maryam.save();
		IdeaDeveloper karim = new IdeaDeveloper("karim", "karim", "karim",
				"karim.abdo1991@gmail.com", "1/1/2000", "karim");
		karim.save();
		/*************************** C2 ******************************/
		IdeaDeveloper osama = new IdeaDeveloper("osama", "osama", "osama",
				"osamaguc@gmail.com", "1/1/2000", "osama");
		osama.save();
		IdeaDeveloper tarek = new IdeaDeveloper("tarek", "tarek", "tarek",
				"xtarx0@gmail.com", "1/1/2000", "tarek");
		tarek.save();
		IdeaDeveloper nataly = new IdeaDeveloper("nataly", "nataly", "nataly",
				"nataly.wadie@gmail.com", "1/1/2000", "nataly");
		nataly.save();
		IdeaDeveloper badawy = new IdeaDeveloper("badawy", "badawy", "badawy",
				"abd.badawy@gmail.com", "1/1/2000", "badawy");
		badawy.save();
		IdeaDeveloper sharif = new IdeaDeveloper("sharif", "sharif", "sharif",
				"sharif.alhef@gmail.com", "1/1/2000", "sharif");
		sharif.save();
		Notification.notify("has updated his profile", sharif, karim,
				new Date());

		sharif.save();

		sharif.save();
		Notification.notify("has added a new idea", sharif, karim, new Date());

		sharif.save();

		sharif.save();
		Notification.notify("has created a new entity", sharif, karim,
				new Date());

		sharif.save();

		/*************************** C3 ******************************/
		IdeaDeveloper dina = new IdeaDeveloper("dina", "dina", "dina",
				"eng.dinatarek@gmail.com", "1/1/2000", "dina");
		dina.save();
		IdeaDeveloper zein = new IdeaDeveloper("zein", "zein", "zein",
				"abdelrahman.zein@gmail.com", "1/1/2000", "zein");
		zein.save();
		IdeaDeveloper amira = new IdeaDeveloper("amira", "amira", "amira",
				"amira.elshimy12@gmail.com", "1/1/2000", "amira");
		amira.save();
		IdeaDeveloper samiha = new IdeaDeveloper("samiha", "samiha", "samiha",
				"samiha.osama@gmail.com", "1/1/2000", "samiha");
		samiha.save();
		/*************************** C4 ******************************/
		IdeaDeveloper sekkina = new IdeaDeveloper("sekkina", "sekkina",
				"sekkina", "mohamed.sekkina@gmail.com", "1/1/2000", "sekkina");
		sekkina.save();
		IdeaDeveloper ghadeer = new IdeaDeveloper("ghadeer", "ghadeer",
				"ghadeer", "ghadeer.eresha@gmail.com", "1/1/2000", "ghadeer");
		ghadeer.save();
		IdeaDeveloper shahir = new IdeaDeveloper("shahir", "shahir", "shahir",
				"shahirsabry@gmail.com", "1/1/2000", "shahir");
		shahir.save();
		IdeaDeveloper dalia = new IdeaDeveloper("dalia", "dalia", "dalia",
				"daliaMokhtar91@gmail.com", "1/1/2000", "dalia");
		dalia.save();
		/*************************** C5 ******************************/
		IdeaDeveloper amr = new IdeaDeveloper("amr", "amr", "amr",
				"amora.1136@gmail.com", "1/1/2000", "amr");
		amr.save();
		IdeaDeveloper doaa = new IdeaDeveloper("doaa", "doaa", "doaa",
				"doaaramiz@gmail.com", "1/1/2000", "doaa");
		doaa.save();
		IdeaDeveloper andrew = new IdeaDeveloper("andrew", "andrew", "andrew",
				"andrew.eldairy@gmail.com", "1/1/2000", "andrew");
		andrew.save();
		IdeaDeveloper ibrahim = new IdeaDeveloper("ibrahim", "ibrahim",
				"ibrahim", "himaszidan@gmail.com", "1/1/2000", "ibrahim");
		ibrahim.save();
		/******************** Anonymous & Admin ********************/
		IdeaDeveloper anonymous = new IdeaDeveloper("anonymous", "anonymous",
				"anonymous", "anonymous@gmail.com", "1/1/2000", "anonymous");
		anonymous.save();
		IdeaDeveloper administrator = new IdeaDeveloper("administrator",
				"administrator", "administrator", "administrator@gmail.com",
				"1/1/2000", "administrator");
		administrator.save();
		/*********************** Organizations ***********************/

		Organization organization1 = Organization.create(karim, "C1",
				"C1s organization", "public");
		organization1.website = "www.google.com";
		organization1.telephone = "123467";
		organization1.save();
		Organization organization2 = Organization.create(osama, "C2",
				"C2s organization", "public");
		organization2.website = "www.google.com";
		organization2.telephone = "123467";
		organization2.save();
		Organization organization3 = Organization.create(dina, "C3",
				"C3s organization", "public");
		organization3.website = "www.google.com";
		organization3.telephone = "123467";
		organization3.save();
		Organization organization4 = Organization.create(sekkina, "C4",
				"C4s organization", "public");
		organization4.website = "www.google.com";
		organization4.telephone = "123467";
		organization4.save();
		Organization organization5 = Organization.create(amr, "C5",
				"C5s organization", "public");
		organization5.website = "www.google.com";
		organization5.telephone = "123467";
		organization5.save();

		/************* Idea Developers Join Organizations ************/

		IdeaDeveloper.joinOrganization(omar, organization1);
		IdeaDeveloper.joinOrganization(otherOmar, organization1);
		IdeaDeveloper.joinOrganization(maryam, organization1);
		IdeaDeveloper.joinOrganization(nataly, organization2);
		IdeaDeveloper.joinOrganization(tarek, organization2);
		IdeaDeveloper.joinOrganization(sharif, organization2);
		IdeaDeveloper.joinOrganization(badawy, organization2);
		IdeaDeveloper.joinOrganization(samiha, organization3);
		IdeaDeveloper.joinOrganization(amira, organization3);
		IdeaDeveloper.joinOrganization(zein, organization3);
		IdeaDeveloper.joinOrganization(dalia, organization4);
		IdeaDeveloper.joinOrganization(ghadeer, organization4);
		IdeaDeveloper.joinOrganization(shahir, organization4);
		IdeaDeveloper.joinOrganization(doaa, organization5);
		IdeaDeveloper.joinOrganization(ibrahim, organization5);
		IdeaDeveloper.joinOrganization(andrew, organization5);

		/********************* Creating Organizers *******************/

		Organizer maryamOr = Organizer.create(maryam);
		maryamOr.save();
		Organizer natalyOr = Organizer.create(nataly);
		natalyOr.save();
		Organizer zeinOr = Organizer.create(zein);
		zeinOr.save();
		Organizer shahirOr = Organizer.create(shahir);
		shahirOr.save();
		Organizer doaaOr = Organizer.create(doaa);
		doaaOr.save();

		/************************** Entities *************************/

		Entities entity1 = organization1.addEntitiyReturn("C1s Entity", karim);
		organization1.save();
		entity1.save();
		Request req = Request.RequestMe(entity1, doaa, "JoinIdeaDeveloper");

		Entities entity2 = organization2.addEntitiyReturn("C2s Entity", osama);
		organization2.save();
		entity2.save();
		Entities entity3 = organization3.addEntitiyReturn("C3s Entity", dina);
		organization3.save();
		entity3.save();
		Entities entity4 = organization4
				.addEntitiyReturn("C4s Entity", sekkina);
		organization4.save();
		entity4.save();
		Entities entity5 = organization5.addEntitiyReturn("C5s Entity", amr);
		organization5.save();
		entity5.save();
		entity1.managers.add(maryamOr);
		entity1.save();
		entity2.managers.add(natalyOr);
		entity2.save();
		entity3.managers.add(zeinOr);
		entity3.save();
		entity4.managers.add(shahirOr);
		entity4.save();
		entity5.managers.add(natalyOr);
		entity5.save();

		/************************* Sub-Entities ************************/

		entity1.addEntity("C1s Sub Entity", maryam);
		entity1.save();
		entity2.addEntity("C2s Sub Entity", nataly);
		entity2.save();
		entity3.addEntity("C3s Sub Entity", zein);
		entity3.save();
		entity4.addEntity("C4s Sub Entity", shahir);
		entity4.save();
		entity5.addEntity("C5s Sub Entity", doaa);
		entity5.save();

		/*********************** Topics In Entities ********************/

		Topic c1Ent1Topic1 = Topic.createTopicEnt("C1 Topic1", "C1 Topic1",
				entity1.id, maryam.id);
		c1Ent1Topic1.postATopic();
		c1Ent1Topic1.save();
		Topic c1Ent1Topic2 = Topic.createTopicEnt("C1 Topic2", "C1 Topic2",
				entity1.id, maryam.id);
		c1Ent1Topic2.postATopic();
		c1Ent1Topic2.save();
		Topic c2Ent1Topic1 = Topic.createTopicEnt("C2 Topic1", "C2 Topic1",
				entity2.id, nataly.id);
		c2Ent1Topic1.postATopic();
		c2Ent1Topic1.save();
		Topic c2Ent1Topic2 = Topic.createTopicEnt("C2 Topic2", "C2 Topic2",
				entity2.id, nataly.id);
		c2Ent1Topic2.postATopic();
		c2Ent1Topic2.save();
		Topic c3Ent1Topic1 = Topic.createTopicEnt("C3 Topic1", "C3 Topic1",
				entity3.id, zein.id);
		c3Ent1Topic1.postATopic();
		c3Ent1Topic1.save();
		Topic c3Ent1Topic2 = Topic.createTopicEnt("C3 Topic2", "C3 Topic2",
				entity3.id, zein.id);
		c3Ent1Topic2.postATopic();
		c3Ent1Topic2.save();
		Topic c4Ent1Topic1 = Topic.createTopicEnt("C4 Topic1", "C4 Topic1",
				entity4.id, shahir.id);
		c4Ent1Topic1.postATopic();
		c4Ent1Topic1.save();
		Topic c4Ent1Topic2 = Topic.createTopicEnt("C4 Topic2", "C4 Topic2",
				entity4.id, shahir.id);
		c4Ent1Topic2.postATopic();
		c4Ent1Topic2.save();
		Topic c5Ent1Topic1 = Topic.createTopicEnt("C5 Topic1", "C5 Topic1",
				entity5.id, doaa.id);
		c5Ent1Topic1.postATopic();
		c5Ent1Topic1.save();
		Topic c5Ent1Topic2 = Topic.createTopicEnt("C5 Topic2", "C5 Topic2",
				entity5.id, doaa.id);
		c5Ent1Topic2.postATopic();
		c5Ent1Topic2.save();

		/********************* Topics In Organizations *******************/

		Topic c1Org1Topic1 = Topic.createTopicOrg("C1 Topic1Org", "C1 Topic1",
				organization1.id, karim.id);
		c1Org1Topic1.postATopic();
		c1Org1Topic1.save();
		Topic c1Org1Topic2 = Topic.createTopicOrg("C1 Topic2Org", "C1 Topic2",
				organization1.id, karim.id);
		c1Org1Topic2.postATopic();
		c1Org1Topic2.save();
		Topic c2Org1Topic1 = Topic.createTopicOrg("C2 Topic1Org", "C2 Topic1",
				organization2.id, osama.id);
		c2Org1Topic1.postATopic();
		c2Org1Topic1.save();
		Topic c2Org1Topic2 = Topic.createTopicOrg("C2 Topic2Org", "C2 Topic2",
				organization2.id, osama.id);
		c2Org1Topic2.postATopic();
		c2Org1Topic2.save();
		Topic c3Org1Topic1 = Topic.createTopicOrg("C3 Topic1Org", "C3 Topic1",
				organization3.id, dina.id);
		c3Org1Topic1.postATopic();
		c3Org1Topic1.save();
		Topic c3Org1Topic2 = Topic.createTopicOrg("C3 Topic2Org", "C3 Topic2",
				organization3.id, dina.id);
		c3Org1Topic2.postATopic();
		c3Org1Topic2.save();
		Topic c4Org1Topic1 = Topic.createTopicOrg("C4 Topic1Org", "C4 Topic1",
				organization4.id, sekkina.id);
		c4Org1Topic1.postATopic();
		c4Org1Topic1.save();
		Topic c4Org1Topic2 = Topic.createTopicOrg("C4 Topic2Org", "C4 Topic2",
				organization4.id, sekkina.id);
		c4Org1Topic2.postATopic();
		c4Org1Topic2.save();
		Topic c5Org1Topic1 = Topic.createTopicOrg("C5 Topic1Org", "C5 Topic1",
				organization5.id, amr.id);
		c5Org1Topic1.postATopic();
		c5Org1Topic1.save();
		Topic c5Org1Topic2 = Topic.createTopicOrg("C5 Topic2Org", "C5 Topic2",
				organization5.id, amr.id);
		c5Org1Topic2.postATopic();
		c5Org1Topic2.save();

		/****************** Ideas In Topics In Entities *****************/

		Idea c1Ent1Top1Idea1 = Idea.createIdeaTopic("C1 Topic1 Idea1",
				"C1 Topic1 Idea1", omar.id, c1Ent1Topic1.id);
		c1Ent1Top1Idea1.postAnIdea();
		c1Ent1Top1Idea1.save();
		Idea c1Ent1Top1Idea2 = Idea.createIdeaTopic("C1 Topic1 Idea2",
				"C1 Topic1 Idea2", otherOmar.id, c1Ent1Topic1.id);
		c1Ent1Top1Idea2.postAnIdea();
		c1Ent1Top1Idea2.save();

		Idea c2Ent1Top1Idea1 = Idea.createIdeaTopic("C2 Topic1 Idea1",
				"C2 Topic1 Idea1", badawy.id, c2Ent1Topic1.id);
		c2Ent1Top1Idea1.postAnIdea();
		c2Ent1Top1Idea1.save();
		Idea c2Ent1Top1Idea2 = Idea.createIdeaTopic("C2 Topic1 Idea2",
				"C2 Topic1 Idea2", tarek.id, c2Ent1Topic1.id);
		c2Ent1Top1Idea2.postAnIdea();
		c2Ent1Top1Idea2.save();

		Idea c3Ent1Top1Idea1 = Idea.createIdeaTopic("C3 Topic1 Idea1",
				"C3 Topic1 Idea1", amira.id, c3Ent1Topic1.id);
		c3Ent1Top1Idea1.postAnIdea();
		c3Ent1Top1Idea1.save();
		Idea c3Ent1Top1Idea2 = Idea.createIdeaTopic("C3 Topic1 Idea2",
				"C3 Topic1 Idea2", samiha.id, c3Ent1Topic1.id);
		c3Ent1Top1Idea2.postAnIdea();
		c3Ent1Top1Idea2.save();

		Idea c4Ent1Top1Idea1 = Idea.createIdeaTopic("C4 Topic1 Idea1",
				"C4 Topic1 Idea1", dalia.id, c4Ent1Topic1.id);
		c4Ent1Top1Idea1.postAnIdea();
		c4Ent1Top1Idea1.save();
		Idea c4Ent1Top1Idea2 = Idea.createIdeaTopic("C4 Topic1 Idea2",
				"C4 Topic1 Idea2", ghadeer.id, c4Ent1Topic1.id);
		c4Ent1Top1Idea2.postAnIdea();
		c4Ent1Top1Idea2.save();

		Idea c5Ent1Top1Idea1 = Idea.createIdeaTopic("C5 Topic1 Idea1",
				"C5 Topic1 Idea1", ibrahim.id, c5Ent1Topic1.id);
		c5Ent1Top1Idea1.postAnIdea();
		c5Ent1Top1Idea1.save();
		Idea c5Ent1Top1Idea2 = Idea.createIdeaTopic("C5 Topic1 Idea2",
				"C5 Topic1 Idea2", andrew.id, c5Ent1Topic1.id);
		c5Ent1Top1Idea2.postAnIdea();
		c5Ent1Top1Idea2.save();

		Idea c1Ent1Top2Idea1 = Idea.createIdeaTopic("C1 Topic2 Idea1",
				"C1 Topic2 Idea1", omar.id, c1Ent1Topic2.id);
		c1Ent1Top2Idea1.postAnIdea();
		c1Ent1Top2Idea1.save();
		Idea c1Ent1Top2Idea2 = Idea.createIdeaTopic("C1 Topic2 Idea2",
				"C1 Topic2 Idea2", otherOmar.id, c1Ent1Topic2.id);
		c1Ent1Top2Idea2.postAnIdea();
		c1Ent1Top2Idea2.save();

		Idea c2Ent1Top2Idea1 = Idea.createIdeaTopic("C2 Topic2 Idea1",
				"C2 Topic2 Idea1", osama.id, c2Ent1Topic2.id);
		c2Ent1Top2Idea1.postAnIdea();
		c2Ent1Top2Idea1.save();
		Idea c2Ent1Top2Idea2 = Idea.createIdeaTopic("C2 Topic2 Idea2",
				"C2 Topic2 Idea2", nataly.id, c2Ent1Topic2.id);
		c2Ent1Top2Idea2.postAnIdea();
		c2Ent1Top2Idea2.save();

		Idea c3Ent1Top2Idea1 = Idea.createIdeaTopic("C3 Topic2 Idea1",
				"C3 Topic2 Idea1", samiha.id, c3Ent1Topic2.id);
		c3Ent1Top2Idea1.postAnIdea();
		c3Ent1Top2Idea1.save();
		Idea c3Ent1Top2Idea2 = Idea.createIdeaTopic("C3 Topic2 Idea2",
				"C3 Topic2 Idea2", amira.id, c3Ent1Topic2.id);
		c3Ent1Top2Idea2.postAnIdea();
		c3Ent1Top2Idea2.save();

		Idea c4Ent1Top2Idea1 = Idea.createIdeaTopic("C4 Topic2 Idea1",
				"C4 Topic2 Idea1", sekkina.id, c4Ent1Topic2.id);
		c4Ent1Top2Idea1.postAnIdea();
		c4Ent1Top2Idea1.save();
		Idea c4Ent1Top2Idea2 = Idea.createIdeaTopic("C4 Topic2 Idea2",
				"C4 Topic2 Idea2", ghadeer.id, c4Ent1Topic2.id);
		c4Ent1Top2Idea2.postAnIdea();
		c4Ent1Top2Idea2.save();

		Idea c5Ent1Top2Idea1 = Idea.createIdeaTopic("C5 Topic2 Idea1",
				"C5 Topic2 Idea1", doaa.id, c5Ent1Topic2.id);
		c5Ent1Top2Idea1.postAnIdea();
		c5Ent1Top2Idea1.save();
		Idea c5Ent1Top2Idea2 = Idea.createIdeaTopic("C5 Topic2 Idea2",
				"C5 Topic2 Idea2", ibrahim.id, c5Ent1Topic2.id);
		c5Ent1Top2Idea2.postAnIdea();
		c5Ent1Top2Idea2.save();

		/**************** Ideas In Topics In Organizations ****************/

		Idea c1Org1Top1Idea1 = Idea.createIdeaTopic(
				"C1 Topic1 In Organization Idea1", "C1 Topic1 Idea1", karim.id,
				c1Org1Topic1.id);
		c1Org1Top1Idea1.postAnIdea();
		c1Org1Top1Idea1.save();
		Idea c1Org1Top1Idea2 = Idea.createIdeaTopic(
				"C1 Topic1 In Organization Idea2", "C1 Topic1 Idea2",
				maryam.id, c1Org1Topic1.id);
		c1Org1Top1Idea2.postAnIdea();
		c1Org1Top1Idea2.save();

		Idea c2Org1Top1Idea1 = Idea.createIdeaTopic(
				"C2 Topic1 In Organization Idea1", "C2 Topic1 Idea1",
				badawy.id, c2Org1Topic1.id);
		c2Org1Top1Idea1.postAnIdea();
		c2Org1Top1Idea1.save();
		Idea c2Org1Top1Idea2 = Idea.createIdeaTopic(
				"C2 Topic1 In Organization Idea2", "C2 Topic1 Idea2", tarek.id,
				c2Org1Topic1.id);
		c2Org1Top1Idea2.postAnIdea();
		c2Org1Top1Idea2.save();

		Idea c3Org1Top1Idea1 = Idea.createIdeaTopic(
				"C3 Topic1 In Organization Idea1", "C3 Topic1 Idea1", dina.id,
				c3Org1Topic1.id);
		c3Org1Top1Idea1.postAnIdea();
		c3Org1Top1Idea1.save();
		Idea c3Org1Top1Idea2 = Idea.createIdeaTopic(
				"C3 Topic1 In Organization Idea2", "C3 Topic1 Idea2", zein.id,
				c3Org1Topic1.id);
		c3Org1Top1Idea2.postAnIdea();
		c3Org1Top1Idea2.save();

		Idea c4Org1Top1Idea1 = Idea.createIdeaTopic(
				"C4 Topic1 In Organization Idea1", "C4 Topic1 Idea1", dalia.id,
				c4Org1Topic1.id);
		c4Org1Top1Idea1.postAnIdea();
		c4Org1Top1Idea1.save();
		Idea c4Org1Top1Idea2 = Idea.createIdeaTopic(
				"C4 Topic1 In Organization Idea2", "C4 Topic1 Idea2",
				shahir.id, c4Org1Topic1.id);
		c4Org1Top1Idea2.postAnIdea();
		c4Org1Top1Idea2.save();

		Idea c5Org1Top1Idea1 = Idea.createIdeaTopic(
				"C5 Topic1 In Organization Idea1", "C5 Topic1 Idea1", amr.id,
				c5Org1Topic1.id);
		c5Org1Top1Idea1.postAnIdea();
		c5Org1Top1Idea1.save();
		Idea c5Org1Top1Idea2 = Idea.createIdeaTopic(
				"C5 Topic1 In Organization Idea2", "C5 Topic1 Idea2",
				andrew.id, c5Org1Topic1.id);
		c5Org1Top1Idea2.postAnIdea();
		c5Org1Top1Idea2.save();

		Idea c1Org1Top2Idea1 = Idea.createIdeaTopic(
				"C1 Topic2 In Organization Idea1", "C1 Topic2 Idea1", omar.id,
				c1Org1Topic2.id);
		c1Org1Top2Idea1.postAnIdea();
		c1Org1Top2Idea1.save();
		Idea c1Org1Top2Idea2 = Idea.createIdeaTopic(
				"C1 Topic2 In Organization Idea2", "C1 Topic2 Idea2",
				otherOmar.id, c1Org1Topic2.id);
		c1Org1Top2Idea2.postAnIdea();
		c1Org1Top2Idea2.save();

		Idea c2Org1Top2Idea1 = Idea.createIdeaTopic(
				"C2 Topic2 In Organization Idea1", "C2 Topic2 Idea1", osama.id,
				c2Org1Topic2.id);
		c2Org1Top2Idea1.postAnIdea();
		c2Org1Top2Idea1.save();
		Idea c2Org1Top2Idea2 = Idea.createIdeaTopic(
				"C2 Topic2 In Organization Idea2", "C2 Topic2 Idea2",
				nataly.id, c2Org1Topic2.id);
		c2Org1Top2Idea2.postAnIdea();
		c2Org1Top2Idea2.save();

		Idea c3Org1Top2Idea1 = Idea.createIdeaTopic(
				"C3 Topic2 In Organization Idea1", "C3 Topic2 Idea1",
				samiha.id, c3Org1Topic2.id);
		c3Org1Top2Idea1.postAnIdea();
		c3Org1Top2Idea1.save();
		Idea c3Org1Top2Idea2 = Idea.createIdeaTopic(
				"C3 Topic2 In Organization Idea2", "C3 Topic2 Idea2", amira.id,
				c3Org1Topic2.id);
		c3Org1Top2Idea2.postAnIdea();
		c3Org1Top2Idea2.save();

		Idea c4Org1Top2Idea1 = Idea.createIdeaTopic(
				"C4 Topic2 In Organization Idea1", "C4 Topic2 Idea1",
				sekkina.id, c4Org1Topic2.id);
		c4Org1Top2Idea1.postAnIdea();
		c4Org1Top2Idea1.save();
		Idea c4Org1Top2Idea2 = Idea.createIdeaTopic(
				"C4 Topic2 In Organization Idea2", "C4 Topic2 Idea2",
				ghadeer.id, c4Org1Topic2.id);
		c4Org1Top2Idea2.postAnIdea();
		c4Org1Top2Idea2.save();

		Idea c5Org1Top2Idea1 = Idea.createIdeaTopic(
				"C5 Topic2 In Organization Idea1", "C5 Topic2 Idea1", doaa.id,
				c5Org1Topic2.id);
		c5Org1Top2Idea1.postAnIdea();
		c5Org1Top2Idea1.save();
		Idea c5Org1Top2Idea2 = Idea.createIdeaTopic(
				"C5 Topic2 In Organization Idea2", "C5 Topic2 Idea2",
				ibrahim.id, c5Org1Topic2.id);
		c5Org1Top2Idea2.postAnIdea();
		c5Org1Top2Idea2.save();

		/********************* Ideas In Entities *********************/

		Idea c1Ent1Idea1 = Idea.createIdeaEntity("C1 Idea1 In Entity",
				"Idea In Entity", otherOmar.id, entity1.id);
		c1Ent1Idea1.postAnIdea();
		c1Ent1Idea1.save();
		Idea c1Ent1Idea2 = Idea.createIdeaEntity("C1 Idea2 In Entity",
				"Idea In Entity", omar.id, entity1.id);
		c1Ent1Idea2.postAnIdea();
		c1Ent1Idea2.save();
		Idea c2Ent1Idea1 = Idea.createIdeaEntity("C2 Idea1 In Entity",
				"Idea In Entity", osama.id, entity2.id);
		c1Ent1Idea1.postAnIdea();
		c1Ent1Idea1.save();
		Idea c2Ent1Idea2 = Idea.createIdeaEntity("C2 Idea2 In Entity",
				"Idea In Entity", sharif.id, entity2.id);
		c2Ent1Idea2.postAnIdea();
		c2Ent1Idea2.save();
		Idea c3Ent1Idea1 = Idea.createIdeaEntity("C3 Idea1 In Entity",
				"Idea In Entity", samiha.id, entity3.id);
		c3Ent1Idea1.postAnIdea();
		c3Ent1Idea1.save();
		Idea c3Ent1Idea2 = Idea.createIdeaEntity("C3 Idea2 In Entity",
				"Idea In Entity", amira.id, entity3.id);
		c3Ent1Idea2.postAnIdea();
		c3Ent1Idea2.save();
		Idea c4Ent1Idea1 = Idea.createIdeaEntity("C4 Idea1 In Entity",
				"Idea In Entity", dalia.id, entity4.id);
		c4Ent1Idea1.postAnIdea();
		c4Ent1Idea1.save();
		Idea c4Ent1Idea2 = Idea.createIdeaEntity("C4 Idea2 In Entity",
				"Idea In Entity", shahir.id, entity4.id);
		c4Ent1Idea2.postAnIdea();
		c4Ent1Idea2.save();
		Idea c5Ent1Idea1 = Idea.createIdeaEntity("C5 Idea1 In Entity",
				"Idea In Entity", doaa.id, entity5.id);
		c5Ent1Idea1.postAnIdea();
		c5Ent1Idea1.save();
		Idea c5Ent1Idea2 = Idea.createIdeaEntity("C5 Idea2 In Entity",
				"Idea In Entity", amr.id, entity5.id);
		c5Ent1Idea2.postAnIdea();
		c5Ent1Idea2.save();

		/****************** Ideas In Organizations ******************/

		Idea c1Org1Idea1 = Idea.createIdeaOrg("C1 Idea1 In Organization",
				"Idea In Organization", maryam.id, organization1.id);
		c1Org1Idea1.postAnIdea();
		c1Org1Idea1.save();
		Idea c1Org1Idea2 = Idea.createIdeaOrg("C1 Idea2 In Organization",
				"Idea In Organization", karim.id, organization1.id);
		c1Org1Idea2.postAnIdea();
		c1Org1Idea2.save();
		Idea c2Org1Idea1 = Idea.createIdeaOrg("C2 Idea1 In Organization",
				"Idea In Organization", nataly.id, organization2.id);
		c2Org1Idea1.postAnIdea();
		c2Org1Idea1.save();
		Idea c2Org1Idea2 = Idea.createIdeaOrg("C2 Idea2 In Organization",
				"Idea In Organization", tarek.id, organization2.id);
		c2Org1Idea2.postAnIdea();
		c2Org1Idea2.save();
		Idea c3Org1Idea1 = Idea.createIdeaOrg("C3 Idea1 In Organization",
				"Idea In Organization", dina.id, organization3.id);
		c3Org1Idea1.postAnIdea();
		c3Org1Idea1.save();
		Idea c3Org1Idea2 = Idea.createIdeaOrg("C3 Idea2 In Organization",
				"Idea In Organization", zein.id, organization3.id);
		c3Org1Idea2.postAnIdea();
		c3Org1Idea2.save();
		Idea c4Org1Idea1 = Idea.createIdeaOrg("C4 Idea1 In Organization",
				"Idea In Organization", sekkina.id, organization4.id);
		c4Org1Idea1.postAnIdea();
		c4Org1Idea1.save();
		Idea c4Org1Idea2 = Idea.createIdeaOrg("C4 Idea2 In Organization",
				"Idea In Organization", shahir.id, organization4.id);
		c4Org1Idea2.postAnIdea();
		c4Org1Idea2.save();
		Idea c5Org1Idea1 = Idea.createIdeaOrg("C5 Idea1 In Organization",
				"Idea In Organization", ibrahim.id, organization5.id);
		c5Org1Idea1.postAnIdea();
		c5Org1Idea1.save();
		Idea c5Org1Idea2 = Idea.createIdeaOrg("C5 Idea2 In Organization",
				"Idea In Organization", andrew.id, organization5.id);
		c5Org1Idea2.postAnIdea();
		c5Org1Idea2.save();

		/************** Tags For Topics And Ideas In Entities *************/

		c1Ent1Topic1.addTag("C1TagEnt");
		c1Ent1Topic2.addTag("C1TagEnt");
		c2Ent1Topic1.addTag("C2TagEnt");
		c2Ent1Topic2.addTag("C2TagEnt");
		c3Ent1Topic1.addTag("C3TagEnt");
		c3Ent1Topic2.addTag("C3TagEnt");
		c4Ent1Topic1.addTag("C4TagEnt");
		c4Ent1Topic2.addTag("C4TagEnt");
		c5Ent1Topic1.addTag("C5TagEnt");
		c5Ent1Topic2.addTag("C5TagEnt");
		c1Ent1Top1Idea1.addTag("C1TagEnt");
		c1Ent1Top1Idea2.addTag("C1TagEnt");
		c1Ent1Top2Idea1.addTag("C1TagEnt");
		c1Ent1Top2Idea2.addTag("C1TagEnt");
		c2Ent1Top1Idea1.addTag("C2TagEnt");
		c2Ent1Top1Idea2.addTag("C2TagEnt");
		c2Ent1Top2Idea1.addTag("C2TagEnt");
		c2Ent1Top2Idea2.addTag("C2TagEnt");
		c3Ent1Top1Idea1.addTag("C3TagEnt");
		c3Ent1Top1Idea2.addTag("C3TagEnt");
		c3Ent1Top2Idea1.addTag("C3TagEnt");
		c3Ent1Top2Idea2.addTag("C3TagEnt");
		c4Ent1Top1Idea1.addTag("C4TagEnt");
		c4Ent1Top1Idea2.addTag("C4TagEnt");
		c4Ent1Top2Idea1.addTag("C4TagEnt");
		c4Ent1Top2Idea2.addTag("C4TagEnt");
		c5Ent1Top1Idea1.addTag("C5TagEnt");
		c5Ent1Top1Idea2.addTag("C5TagEnt");
		c5Ent1Top2Idea1.addTag("C5TagEnt");
		c5Ent1Top2Idea2.addTag("C5TagEnt");

		/************** Tags For Topics And Ideas In Organization ************/

		c1Org1Topic1.addTag("C1TagOrg");
		c1Org1Topic2.addTag("C1TagOrg");
		c2Org1Topic1.addTag("C2TagOrg");
		c2Org1Topic2.addTag("C2TagOrg");
		c3Org1Topic1.addTag("C3TagOrg");
		c3Org1Topic2.addTag("C3TagOrg");
		c4Org1Topic1.addTag("C4TagOrg");
		c4Org1Topic2.addTag("C4TagOrg");
		c5Org1Topic1.addTag("C5TagOrg");
		c5Org1Topic2.addTag("C5TagOrg");
		c1Org1Top1Idea1.addTag("C1TagOrg");
		c1Org1Top1Idea2.addTag("C1TagOrg");
		c1Org1Top2Idea1.addTag("C1TagOrg");
		c1Org1Top2Idea2.addTag("C1TagOrg");
		c2Org1Top1Idea1.addTag("C2TagOrg");
		c2Org1Top1Idea2.addTag("C2TagOrg");
		c2Org1Top2Idea1.addTag("C2TagOrg");
		c2Org1Top2Idea2.addTag("C2TagOrg");
		c3Org1Top1Idea1.addTag("C3TagOrg");
		c3Org1Top1Idea2.addTag("C3TagOrg");
		c3Org1Top2Idea1.addTag("C3TagOrg");
		c3Org1Top2Idea2.addTag("C3TagOrg");
		c4Org1Top1Idea1.addTag("C4TagOrg");
		c4Org1Top1Idea2.addTag("C4TagOrg");
		c4Org1Top2Idea1.addTag("C4TagOrg");
		c4Org1Top2Idea2.addTag("C4TagOrg");
		c5Org1Top1Idea1.addTag("C5TagOrg");
		c5Org1Top1Idea1.addTag("C5TagOrg");
		c5Org1Top2Idea1.addTag("C5TagOrg");
		c5Org1Top2Idea1.addTag("C5TagOrg");

		/**************** Tags For Ideas In Organization ****************/

		c1Org1Idea1.addTag("C1IdeaOrgTag");
		c1Org1Idea2.addTag("C1IdeaOrgTag");
		c2Org1Idea1.addTag("C2IdeaOrgTag");
		c2Org1Idea2.addTag("C2IdeaOrgTag");
		c3Org1Idea1.addTag("C3IdeaOrgTag");
		c3Org1Idea2.addTag("C3IdeaOrgTag");
		c4Org1Idea1.addTag("C4IdeaOrgTag");
		c4Org1Idea2.addTag("C4IdeaOrgTag");
		c5Org1Idea1.addTag("C5IdeaOrgTag");
		c5Org1Idea2.addTag("C5IdeaOrgTag");

		/***************** Tags For Ideas In Organization ***************/

		c1Ent1Idea1.addTag("C1IdeaEntTag");
		c1Ent1Idea2.addTag("C1IdeaEntTag");
		c2Ent1Idea1.addTag("C2IdeaEntTag");
		c2Ent1Idea2.addTag("C2IdeaEntTag");
		c3Ent1Idea1.addTag("C3IdeaEntTag");
		c3Ent1Idea2.addTag("C3IdeaEntTag");
		c4Ent1Idea1.addTag("C4IdeaEntTag");
		c4Ent1Idea2.addTag("C4IdeaEntTag");
		c5Ent1Idea1.addTag("C5IdeaEntTag");
		c5Ent1Idea2.addTag("C5IdeaEntTag");

		/********************* Adding Comments To Ideas ****************/

		Comment.create(maryam, c1Ent1Top1Idea1, "Comment1 on Idea1 Topic1 Ent1");
		Comment.create(karim, c1Ent1Top1Idea1, "Comment2 on Idea1 Topic1 Ent1");
		Comment.create(omar, c1Ent1Top1Idea2, "Comment1 on Idea2 Topic1 Ent1");
		Comment.create(otherOmar, c1Ent1Top1Idea2,
				"Comment2 on Idea2 Topic1 Ent1");
		Comment.create(nataly, c2Ent1Top1Idea1, "Comment1 on Idea1 Topic1 Ent1");
		Comment.create(sharif, c2Ent1Top1Idea1, "Comment2 on Idea1 Topic1 Ent1");
		Comment.create(osama, c2Ent1Top1Idea2, "Comment1 on Idea2 Topic1 Ent1");
		Comment.create(tarek, c2Ent1Top1Idea2, "Comment2 on Idea2 Topic1 Ent1");
		Comment.create(dina, c3Ent1Top1Idea1, "Comment1 on Idea1 Topic1 Ent1");
		Comment.create(samiha, c3Ent1Top1Idea1, "Comment2 on Idea1 Topic1 Ent1");
		Comment.create(amira, c3Ent1Top1Idea2, "Comment1 on Idea2 Topic1 Ent1");
		Comment.create(zein, c3Ent1Top1Idea2, "Comment2 on Idea2 Topic1 Ent1");
		Comment.create(sekkina, c4Ent1Top1Idea1,
				"Comment1 on Idea1 Topic1 Ent1");
		Comment.create(ghadeer, c4Ent1Top1Idea1,
				"Comment2 on Idea1 Topic1 Ent1");
		Comment.create(dalia, c4Ent1Top1Idea2, "Comment1 on Idea2 Topic1 Ent1");
		Comment.create(shahir, c4Ent1Top1Idea2, "Comment2 on Idea2 Topic1 Ent1");
		Comment.create(amr, c5Ent1Top1Idea1, "Comment1 on Idea1 Topic1 Ent1");
		Comment.create(doaa, c5Ent1Top1Idea1, "Comment2 on Idea1 Topic1 Ent1");
		Comment.create(ibrahim, c5Ent1Top1Idea2,
				"Comment1 on Idea2 Topic1 Ent1");
		Comment.create(andrew, c5Ent1Top1Idea2, "Comment2 on Idea2 Topic1 Ent1");
		Comment.create(maryam, c1Ent1Top2Idea1, "Comment1 on Idea1 Topic2 Ent1");
		Comment.create(karim, c1Ent1Top2Idea1, "Comment2 on Idea1 Topic2 Ent1");
		Comment.create(omar, c1Ent1Top2Idea2, "Comment1 on Idea2 Topic2 Ent1");
		Comment.create(otherOmar, c1Ent1Top2Idea2,
				"Comment2 on Idea2 Topic2 Ent1");
		Comment.create(nataly, c2Ent1Top2Idea1, "Comment1 on Idea1 Topic2 Ent1");
		Comment.create(sharif, c2Ent1Top2Idea1, "Comment2 on Idea1 Topic2 Ent1");
		Comment.create(osama, c2Ent1Top2Idea2, "Comment1 on Idea2 Topic2 Ent1");
		Comment.create(tarek, c2Ent1Top2Idea2, "Comment2 on Idea2 Topic2 Ent1");
		Comment.create(dina, c3Ent1Top2Idea1, "Comment1 on Idea1 Topic2 Ent1");
		Comment.create(samiha, c3Ent1Top2Idea1, "Comment2 on Idea1 Topic2 Ent1");
		Comment.create(amira, c3Ent1Top2Idea2, "Comment1 on Idea2 Topic2 Ent1");
		Comment.create(zein, c3Ent1Top2Idea2, "Comment2 on Idea2 Topic2 Ent1");
		Comment.create(sekkina, c4Ent1Top2Idea1,
				"Comment1 on Idea1 Topic2 Ent1");
		Comment.create(ghadeer, c4Ent1Top2Idea1,
				"Comment2 on Idea1 Topic2 Ent1");
		Comment.create(dalia, c4Ent1Top2Idea2, "Comment1 on Idea2 Topic2 Ent1");
		Comment.create(shahir, c4Ent1Top2Idea2, "Comment2 on Idea2 Topic2 Ent1");
		Comment.create(amr, c5Ent1Top2Idea1, "Comment1 on Idea1 Topic2 Ent1");
		Comment.create(doaa, c5Ent1Top2Idea1, "Comment2 on Idea1 Topic2 Ent1");
		Comment.create(ibrahim, c5Ent1Top2Idea2,
				"Comment1 on Idea2 Topic2 Ent1");
		Comment.create(andrew, c5Ent1Top2Idea2, "Comment2 on Idea2 Topic2 Ent1");

		/********************** Data For Duplicates ********************/

		Topic c3Ent1SubEnt1Topic1 = Topic.createTopicEnt(
				"Topic for Duplicates", "This topic is for duplicates testing",
				entity3.childern.get(0).id, zein.id);
		c3Ent1SubEnt1Topic1.postATopic();
		Idea c3Ent1SubEnt1Top1Idea1 = Idea.createIdeaTopic("Idea1",
				"Duplicate Test Idea1", zein.id, c3Ent1SubEnt1Topic1.id);
		c3Ent1SubEnt1Top1Idea1.postAnIdea();
		Idea c3Ent1SubEnt1Top1Idea2 = Idea.createIdeaTopic("Idea2",
				"Duplicate Test Idea2", zein.id, c3Ent1SubEnt1Topic1.id);
		c3Ent1SubEnt1Top1Idea2.postAnIdea();
		Idea c3Ent1SubEnt1Top1Idea3 = Idea.createIdeaTopic("Idea3",
				"Duplicate Test Idea3", zein.id, c3Ent1SubEnt1Topic1.id);
		c3Ent1SubEnt1Top1Idea3.postAnIdea();
		Idea c3Ent1SubEnt1Top1Idea4 = Idea.createIdeaTopic("Idea4",
				"Duplicate Test Idea4", zein.id, c3Ent1SubEnt1Topic1.id);
		c3Ent1SubEnt1Top1Idea4.postAnIdea();
		Idea c3Ent1SubEnt1Top1Idea5 = Idea.createIdeaTopic("Idea5",
				"Duplicate Test Idea5", zein.id, c3Ent1SubEnt1Topic1.id);
		c3Ent1SubEnt1Top1Idea5.postAnIdea();
		Idea c3Ent1SubEnt1Top1Idea6 = Idea.createIdeaTopic("Idea6",
				"Duplicate Test Idea6", zein.id, c3Ent1SubEnt1Topic1.id);
		c3Ent1SubEnt1Top1Idea6.postAnIdea();
		Idea c3Ent1SubEnt1Top1Idea7 = Idea.createIdeaTopic("Idea7",
				"Duplicate Test Idea7", zein.id, c3Ent1SubEnt1Topic1.id);
		c3Ent1SubEnt1Top1Idea7.postAnIdea();
		c3Ent1SubEnt1Top1Idea1.duplicates.add(c3Ent1SubEnt1Top1Idea2);
		c3Ent1SubEnt1Top1Idea1.save();
		c3Ent1SubEnt1Top1Idea2.duplicatesOf.add(c3Ent1SubEnt1Top1Idea1);
		c3Ent1SubEnt1Top1Idea2.save();
		c3Ent1SubEnt1Top1Idea1.duplicates.add(c3Ent1SubEnt1Top1Idea3);
		c3Ent1SubEnt1Top1Idea1.save();
		c3Ent1SubEnt1Top1Idea3.duplicatesOf.add(c3Ent1SubEnt1Top1Idea1);
		c3Ent1SubEnt1Top1Idea3.save();
		c3Ent1SubEnt1Top1Idea1.duplicates.add(c3Ent1SubEnt1Top1Idea4);
		c3Ent1SubEnt1Top1Idea1.save();
		c3Ent1SubEnt1Top1Idea4.duplicatesOf.add(c3Ent1SubEnt1Top1Idea1);
		c3Ent1SubEnt1Top1Idea4.save();
		c3Ent1SubEnt1Top1Idea2.duplicates.add(c3Ent1SubEnt1Top1Idea5);
		c3Ent1SubEnt1Top1Idea2.save();
		c3Ent1SubEnt1Top1Idea5.duplicatesOf.add(c3Ent1SubEnt1Top1Idea2);
		c3Ent1SubEnt1Top1Idea5.save();
		c3Ent1SubEnt1Top1Idea1.duplicates.add(c3Ent1SubEnt1Top1Idea6);
		c3Ent1SubEnt1Top1Idea1.save();
		c3Ent1SubEnt1Top1Idea6.duplicatesOf.add(c3Ent1SubEnt1Top1Idea1);
		c3Ent1SubEnt1Top1Idea6.save();
		c3Ent1SubEnt1Top1Idea2.duplicates.add(c3Ent1SubEnt1Top1Idea7);
		c3Ent1SubEnt1Top1Idea2.save();
		c3Ent1SubEnt1Top1Idea7.duplicatesOf.add(c3Ent1SubEnt1Top1Idea2);
		c3Ent1SubEnt1Top1Idea7.save();
		Date startItem1 = new Date(111, 4, 5);
		Date endItem1 = new Date(111, 6, 7);
		Date startItem2 = new Date(111, 4, 7);
		Date endItem2 = new Date(111, 6, 10);

		/***************** Action Plans ***************/
		ActionPlan actionPlan = new ActionPlan();
		actionPlan.name = "amr";
		actionPlan.description = "Description";
		actionPlan.requirment = "req";
		actionPlan.status = "status";
		Date start = new Date(111, 4, 5);
		Date end = new Date(111, 8, 9);
		actionPlan.startDate = start;
		actionPlan.endDate = end;
		actionPlan.organizationId = organization5.id;
		actionPlan.save();
		ibrahim.volunteer.add(actionPlan);
		ibrahim.save();
		Date sss = new Date(111, 6, 7);
		Date eee = new Date(111, 7, 8);
		ActionItem one = new ActionItem("one", "Amr", sss, eee);
		one.actionPlan = actionPlan;
		one.save();
		ActionItem two = new ActionItem("two", "Kratos", sss, eee);
		two.actionPlan = actionPlan;
		two.save();
		actionPlan.actionItems.add(one);
		actionPlan.actionItems.add(two);
		actionPlan.save();

		actionPlan.managers.add(doaaOr);
		actionPlan.save();
		doaaOr.managedActionPlane.add(actionPlan);
		doaaOr.save();

		actionPlan.volunteers.add(ibrahim);
		organization5.ideas.add(c5Ent1Top1Idea1);
		c5Ent1Top1Idea1.ideaOrg = organization5;
		c5Ent1Top1Idea1.save();
		organization5.save();
		organization5.ideas.add(c5Ent1Top1Idea2);
		c5Ent1Top1Idea2.ideaOrg = organization5;
		c5Ent1Top1Idea2.save();
		organization5.save();
		organization5.ideas.add(c5Ent1Top2Idea1);
		c5Ent1Top2Idea1.ideaOrg = organization5;
		c5Ent1Top2Idea1.save();
		organization5.save();
		organization5.ideas.add(c5Ent1Top2Idea2);
		c5Ent1Top2Idea2.ideaOrg = organization5;
		c5Ent1Top2Idea2.save();
		organization5.save();
		actionPlan.ideas.add(c5Ent1Top1Idea1);
		c5Ent1Top1Idea1.ideaPlan = actionPlan;
		actionPlan.save();
		c5Ent1Top1Idea1.save();

	}

}
